package com.murphy.algorithm.likou;

/**
 * 阶乘
 * n!
 * @author dongsufeng
 * @version 4.0
 * @date 2023/2/23 15:28
 */
public class Recursion {

    public int function(int n){
        if (n<=1){
            return 1;
        }
        return n * function(n-1);
    }

    public static void main(String[] args) {
        Recursion recursion = new Recursion();
        System.out.println(recursion.function(6));
    }
}
